package com.atguigu.jucdemo.DeadLockDemo;
//ThreadPollExecutor
//ThreadPollExecutor
//ThreadPollExecutor
//ThreadPollExecutor
//ThreadPollExecutor
public class DieLockDemo01 {
    public static void main(String[] args) {
        t1 t1 = new t1();
        t2 t2 = new t2();

        new Thread(()->{
            synchronized (t1){
                System.out.println(Thread.currentThread().getName()+"执行了");
                /*try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }*/
                synchronized (t2){

                }

            }
        },"t1").start();

        new Thread(()->{
            synchronized (t2){
                System.out.println(Thread.currentThread().getName()+"执行了");
                /*try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }*/
                synchronized (t1){

                }

            }
        },"t2").start();
    }
}
